.box{
    margin:20px;
    width:300px;
    height:300px;
    background:lightblue;
}

.shake:hover{
    animation: shake 1s;
    -o-animation: shake 1s;
    -webkit-animation: shake 1s;
    -moz-animation: shake 1s;
}